package com.deuwise.system.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.deuwise.common.validator.group.AddGroup;
import com.deuwise.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

/**
 * Copyright
 *
 * @author chenwenchao
 * @date 2019/12/31
 * Description:
 */

@Data
@EqualsAndHashCode(callSuper=true)
@TableName("sys_layer_type")
public class LayerTypeDo extends Model<LayerTypeDo> implements Serializable {

    /**主键*/
    @ApiModelProperty("主键")
    @TableId("id")
    public String id;

    /**名称*/
    @ApiModelProperty("名称")
    @TableField("name")
    @Length(max =60,message ="名称长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    public String name;

    @ApiModelProperty("值")
    @TableField("value")
    @Length(max =120,message ="值长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    public String value;


    @ApiModelProperty("排序")
    @TableField("sort")
    public String sort;

    @ApiModelProperty("备注")
    @TableField("remark")
    @Length(max =120,message ="备注长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    public String remark;

    @Override
    protected Serializable pkVal() {
        return id;
    }
}
